package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataScope;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TSaleMapper;
import com.ruoyi.system.domain.TSale;
import com.ruoyi.system.service.ITSaleService;
import com.ruoyi.common.core.text.Convert;

/**
 * 销售 服务层实现
 * 
 * @author ruoyi
 * @date 2019-05-08
 */
@Service
public class TSaleServiceImpl implements ITSaleService 
{
	@Autowired
	private TSaleMapper tSaleMapper;

	/**
     * 查询销售信息
     * 
     * @param id 销售ID
     * @return 销售信息
     */
    @Override
	public TSale selectTSaleById(Long id)
	{
	    return tSaleMapper.selectTSaleById(id);
	}
	
	/**
     * 查询销售列表
     * 
     * @param tSale 销售信息
     * @return 销售集合
     */
	@Override
	@DataScope(tableAlias = "t")
	public List<TSale> selectTSaleList(TSale tSale)
	{
	    return tSaleMapper.selectTSaleList(tSale);
	}
	
    /**
     * 新增销售
     * 
     * @param tSale 销售信息
     * @return 结果
     */
	@Override
	public int insertTSale(TSale tSale)
	{
	    return tSaleMapper.insertTSale(tSale);
	}
	
	/**
     * 修改销售
     * 
     * @param tSale 销售信息
     * @return 结果
     */
	@Override
	public int updateTSale(TSale tSale)
	{
	    return tSaleMapper.updateTSale(tSale);
	}

	/**
     * 删除销售对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteTSaleByIds(String ids)
	{
		return tSaleMapper.deleteTSaleByIds(Convert.toStrArray(ids));
	}
	
}
